/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ma.projet.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Maison
 */
@Entity
@Table(name = "sousreseau")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sousreseau.findAll", query = "SELECT s FROM Sousreseau s"),
    @NamedQuery(name = "Sousreseau.findBySousreseauID", query = "SELECT s FROM Sousreseau s WHERE s.sousreseauID = :sousreseauID"),
    @NamedQuery(name = "Sousreseau.findByLibelle", query = "SELECT s FROM Sousreseau s WHERE s.libelle = :libelle"),
    @NamedQuery(name = "Sousreseau.findByActive", query = "SELECT s FROM Sousreseau s WHERE s.active = :active")})
public class Sousreseau implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sousreseauID")
    private Long sousreseauID;
    @Size(max = 254)
    @Column(name = "libelle")
    private String libelle;
    @Column(name = "active")
    private Boolean active;

    public Sousreseau() {
    }

    public Sousreseau(Long sousreseauID) {
        this.sousreseauID = sousreseauID;
    }

    public Long getSousreseauID() {
        return sousreseauID;
    }

    public void setSousreseauID(Long sousreseauID) {
        this.sousreseauID = sousreseauID;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sousreseauID != null ? sousreseauID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sousreseau)) {
            return false;
        }
        Sousreseau other = (Sousreseau) object;
        if ((this.sousreseauID == null && other.sousreseauID != null) || (this.sousreseauID != null && !this.sousreseauID.equals(other.sousreseauID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ma.projet.entities.Sousreseau[ sousreseauID=" + sousreseauID + " ]";
    }
    
}
